#ifndef ELEMENT_H
#define ELEMENT_H

#include <QtGui>

#include "movetype.h"

#define DEFAULT_RADIUS 20
#define NODE_RADIUS 10

class Element : public QGraphicsObject
{
    Q_OBJECT

public:
    MoveType moveType;
    int radius;

    Element();
    ~Element();
    QRectF boundingRect() const;
    QGraphicsEllipseItem* getMoveCircle();
    void setMoveCircleRadius(int);
    void addNode(qreal, qreal);
    void removeNode(QGraphicsEllipseItem*);
    void drawPath();
    QVector<QGraphicsEllipseItem*> getNodes();
    virtual QString toString() = 0;

signals:
    void selectedChange(Element*);

protected:
    QGraphicsEllipseItem *moveCircle;
    QVector<QGraphicsEllipseItem*> *nodes;
    int nodeCounter;

    void setPainter(QPainter*);
    QVariant itemChange(GraphicsItemChange, const QVariant&);
};

#endif // ELEMENT_H
